import redis
import time

class DistributedLock:
    _instance = None

    def __new__(cls, redis_host, redis_port, lock_key, expire_time):
        if not cls._instance:
            cls._instance = super().__new__(cls)
        return cls._instance

    def __init__(self, redis_host, redis_port, lock_key, expire_time):
        if not hasattr(self, 'redis'):
            self.redis = redis.Redis(host=redis_host, port=redis_port)
        self.lock_key = lock_key
        self.expire_time = expire_time

    def acquire_lock(self):
        while True:
            if self.redis.set(self.lock_key, "locked", nx=True, ex=self.expire_time):
                return True
            else:
                time.sleep(0.1)

    def release_lock(self):
        self.redis.delete(self.lock_key)